/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sn.gandal.mobile.kalpet.persistence;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @version V 1.0 01/03/2010
 * @author SOWDIOMYERO
 */
@Entity
@Table(name = "compte_credit", catalog = "kmobile", schema = "")
@NamedQueries({
    @NamedQuery(name = "CompteCredit.findAll", query = "SELECT c FROM CompteCredit c"),
    @NamedQuery(name = "CompteCredit.findById", query = "SELECT c FROM CompteCredit c WHERE c.id = :id"),
    @NamedQuery(name = "CompteCredit.findByDateCreated", query = "SELECT c FROM CompteCredit c WHERE c.dateCreated = :dateCreated"),
    @NamedQuery(name = "CompteCredit.findByDateUpdated", query = "SELECT c FROM CompteCredit c WHERE c.dateUpdated = :dateUpdated"),
    @NamedQuery(name = "CompteCredit.findByGestionnaire", query = "SELECT c FROM CompteCredit c WHERE c.gestionnaire = :gestionnaire"),
    @NamedQuery(name = "CompteCredit.findByNumero", query = "SELECT c FROM CompteCredit c WHERE c.numero = :numero"),
    @NamedQuery(name = "CompteCredit.findByCarteLiees", query = "SELECT c FROM CompteCredit c WHERE c.carteLiees = :carteLiees")})
public class CompteCredit implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(name = "dateCreated", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateCreated;
    @Basic(optional = false)
    @Column(name = "dateUpdated", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateUpdated;
    @Basic(optional = false)
    @Column(name = "gestionnaire", nullable = false)
    private int gestionnaire;
    @Basic(optional = false)
    @Column(name = "numero", nullable = false)
    private int numero;
    @Basic(optional = false)
    @Column(name = "carteLiees", nullable = false)
    private int carteLiees;
    @OneToMany(mappedBy = "compteCredit", fetch = FetchType.LAZY)
    private List<Account> accountList;

    public CompteCredit() {
    }

    public CompteCredit(Integer id) {
        this.id = id;
    }

    public CompteCredit(Integer id, Date dateCreated, Date dateUpdated, int gestionnaire, int numero, int carteLiees) {
        this.id = id;
        this.dateCreated = dateCreated;
        this.dateUpdated = dateUpdated;
        this.gestionnaire = gestionnaire;
        this.numero = numero;
        this.carteLiees = carteLiees;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDateCreated() {
        return dateCreated;
    }

    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    public Date getDateUpdated() {
        return dateUpdated;
    }

    public void setDateUpdated(Date dateUpdated) {
        this.dateUpdated = dateUpdated;
    }

    public int getGestionnaire() {
        return gestionnaire;
    }

    public void setGestionnaire(int gestionnaire) {
        this.gestionnaire = gestionnaire;
    }

    public int getNumero() {
        return numero;
    }

    public void setNumero(int numero) {
        this.numero = numero;
    }

    public int getCarteLiees() {
        return carteLiees;
    }

    public void setCarteLiees(int carteLiees) {
        this.carteLiees = carteLiees;
    }

    public List<Account> getAccountList() {
        return accountList;
    }

    public void setAccountList(List<Account> accountList) {
        this.accountList = accountList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CompteCredit)) {
            return false;
        }
        CompteCredit other = (CompteCredit) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sn.gandal.mobile.kalpet.persistence.CompteCredit[id=" + id + "]";
    }

}
